perm filename PROB3.PUB[LSP,JRA]3 blob sn#090225 filedate 1974-03-06 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	.GROUP SKIP 1
C00004 ENDMK
C⊗;
.GROUP SKIP 1;
.BEGIN CENTERIT;TABIT2(10,23);SELECT 1;
II  Use the following definition:
.GROUP;

%3
\  twist[s] <=\[atom[s] → s;
\\ T → cons[twist[cdr[s]];twist[car[s]]]]
  

%21%1. Is the function partial or is it total?

Now evaluate: 
%22.%3 twist[A]   %23.%3 twist[(A . B)]   %24.%3 twist[((A . B). C)]
.APART
.GROUP

%1
III  Now try:
%3
\findem[x;y] <=\[atom[x] → [eq[x;y] → T; T → NIL];
\\ T → cons[findem[car[x];y];findem[cdr[x];y]]]


%21%1.  Is this function total?

and now evaluate:
←%22.%3 findem[(A . B);A]   %23.%3 findem[(B .(A . C));A]  %24.%3 findem[(B .(A . C));C] 
←%25.%3 findem[(A . B);(A . B)]
.APART

.END